package 设计模式.observer.util;

import java.util.Observable;

/**
 * @功能
 * @创建时间 2020/5/4
 */
public class ConcreteSubject extends Observable {
    private int state;
    public void set(int t ){
        state=t; //目标状态发生了改变
        setChanged(); //目标状态已经改变
        notifyObservers(state); //通知其他观察者

    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }
}
